Graphics processing systems

ABSTRACT

When processing graphics primitives in a graphics processing system, the render output is divided into a plurality of regions for rendering, each region comprising a respective area of the render output. It is determined for which of the plurality of regions of the render output a primitive should be rendered for. Associated state data for rendering the primitive is stored in a “state data” data structure in memory. For each region of the render output it is determined the primitive should be rendered for, a reference to the associated state data for rendering the primitive is stored in a respective, different data structure for each different region of the render output it is determined the primitive should be rendered for.

BACKGROUND

The technology described herein relates to computer graphics processing and in particular to the processing of graphics primitives during the rendering of an output.

Graphics processing is normally carried out by first dividing the graphics processing (render) output to be rendered, such as a frame to be displayed, into a number of similar basic components (so-called “primitives”) to allow the graphics processing operations to be more easily carried out. These “primitives” are usually in the form of simple polygons, such as triangles.

Each primitive is at this stage defined by and represented as a set of vertices. Each vertex for a primitive has associated with it a set of data (such as position, colour, texture and other attributes data) representing the vertex. This “vertex data” is then used, e.g., when rasterising and rendering the primitive(s) to which the vertex relates in order to generate the desired render output of the graphics processing system.

For a given output, e.g. frame to be displayed, to be generated by the graphics processing system, there will typically be a set of vertices defined for the output in question. The primitives to be processed for the output will then be indicated as comprising given vertices in the set of vertices for the graphics processing output being generated. Typically, the overall output, e.g. frame to be generated, will be divided into smaller units of processing, referred to as “draw calls”. Each draw call will have a respective set of vertices defined for it and a set of primitives that use those vertices. For a given frame, there may, e.g., be of the order of a few hundred draw calls, and hundreds of thousands of primitives.

Once primitives and their vertices have been generated and defined, they can be processed by the graphics processing system, in order to generate the desired graphics processing output (render target), such as a frame for display. This basically involves determining which sampling points of an array of sampling points associated with the render output area to be processed are covered by a primitive, and then determining the appearance each sampling point should have (e.g. in terms of its colour, etc.) to represent the primitive at that sampling point. These processes are commonly referred to as rasterising and rendering, respectively. (The term “rasterisation” is sometimes used to mean both primitive conversion to sample positions and rendering. However, herein “rasterisation” will be used to refer to converting primitive data to sampling point addresses only.)

The rasterising and rendering processes use the vertex attributes associated with the vertices of the primitives that are being processed. To facilitate this operation, the attributes of the vertices defined for the given graphics processing output (e.g. draw call) are usually subjected to an initial so-called “vertex shading” operation, before the primitives are rasterised and rendered. This “vertex shading” operation operates to transform the attributes for each vertex into a desired form for the subsequent graphics processing operations. This may comprise, for example, transforming vertex position attributes from the world or user space that they are initially defined for to the screen space that the output of the graphics processing system is to be displayed in.

A graphics processing pipeline will typically therefore include a vertex shading stage (a vertex shader) that executes vertex shading computations on the initial vertex attribute values defined for the vertices so as to generate a desired set of output vertex attributes (i.e. appropriately “shaded” attributes) for use in subsequent processing stages of the graphics processing pipeline.

Once the vertex attributes have been shaded, the “shaded” attributes are then used when processing the vertices (and the primitives to which they relate) in the remainder of the graphics processing pipeline.

One form of graphics processing uses so-called “tile-based” rendering. In tile-based rendering, the two-dimensional render output (i.e. the output of the rendering process, such as an output frame to be displayed) is rendered as a plurality of smaller area regions, usually referred to as “tiles”. In such arrangements, the render output is typically divided (by area) into regularly-sized and shaped rendering tiles (they are usually e.g., squares or rectangles). (Other terms that are commonly used for “tiling” and “tile-based” rendering include “chunking” (the rendering tiles are referred to as “chunks”) and “bucket” rendering. The terms “tile” and “tiling” will be used hereinafter for convenience, but it should be understood that these terms are intended to encompass all alternative and equivalent terms and techniques wherein the render output is rendered as a plurality of smaller area regions.)

In a tile-based graphics processing pipeline, the geometry (primitives) for the render output being generated is sorted into regions of the render output area, so as to allow the geometry (primitives) that need to be processed for each rendering tile to be identified. This sorting allows primitives that need to be processed for a given rendering tile to be identified (so as to, e.g., avoid unnecessarily rendering primitives that are not actually present in a tile). The sorting process produces lists of primitives to be rendered for regions of the render output (commonly referred to as “primitive lists”). Once the primitive lists have been prepared for all the render output regions, each rendering tile is processed, by rasterising and rendering the primitives listed for the rendering tile.

The process of preparing primitive lists for each render output region basically therefore involves determining the primitives that should be rendered for a given render output region. This process is usually carried out by determining (at a desired level of accuracy) the primitives that intersect (i.e. that will appear (at least in part) within) the render output region in question, and then preparing a list of those primitives for future use by the graphics processing system.

It should be noted here that where a primitive falls into more than one render output region, as will frequently be the case, it is included in the primitive list for each region that it falls within. A render output region for which a primitive list is prepared could be a single rendering tile, or a group of plural rendering tiles, etc.

In effect, each render output region can be considered to have a bin (the primitive list) into which any primitive that is found to fall within (i.e. intersect) the region is placed (and, indeed, the process of sorting the primitives on a region-by-region basis in this manner is commonly referred to as “binning”).

It is known to implement the binning in a hierarchical fashion, using various different region sizes (levels in the hierarchy), e.g. going down to the rendering tile size (the lowest level). However, the binning may be performed in a more or less sophisticated manner, as desired.

Thus, in a tile-based processing system there will be an initial processing pass which, in effect, sorts the graphics primitives (and/or other graphics entities, geometry, etc.) to be processed into regions that the render output has been divided into for sorting purposes.

The tiles are then each rendered separately, and the rendered tiles are then recombined to provide the complete render output (e.g. frame for display). The rendering of a primitive for a tile is generally performed using a set of geometry data representing the primitive as well as state data indicative of the operations to be performed when rendering the primitive.

In a tile-based rendering system the primitive lists thus reflect the spatial distribution of the primitives in the render output, i.e. by specifying which primitives should be rendered for which regions/tiles. All of the geometry data for the render output is thus stored together in memory in a data structure for the render output, and the relevant primitive data for rendering a tile is obtained from this data structure by reference to the primitive lists. Any state data is then stored in a further data structure.

The Applicants believe there remains scope for providing alternative, improved graphics processing systems.

BRIEF DESCRIPTION OF THE DRAWINGS

Various embodiments will now be described, by way of example only, and with reference to the accompanying drawings in which:

FIGS. 1, 2 and 3 schematically illustrate the operation of a traditional tile-based graphics processing system;

FIG. 4 shows an example of how primitive data may be organised according to an embodiment;

FIG. 5 shows schematically how the primitive data may be used when generating a render output according to an embodiment;

FIG. 6 shows how state data is processed in a traditional tile-based graphics processing system;

FIG. 7 illustrates the encoding of state data according to an embodiment;

FIG. 8 shows schematically an example of a data structure that may be generated according to an embodiment;

FIG. 9 shows schematically a graphics processing pipeline that a graphics processor may execute according to an embodiment; and

FIG. 10 is a flowchart showing in more detail how primitive data is binned according to an embodiment;

Like reference numerals are used for like elements in the drawings as appropriate.

DETAILED DESCRIPTION

A first embodiment of the technology described herein comprises a method of processing graphics primitives using a graphics processing system comprising a memory and a graphics processor in communication with the memory, wherein the graphics processor is configured to generate a render output by rendering a plurality of primitives for the render output, wherein primitives are rendered by the graphics processor using associated state data indicative of the operations to be performed when rasterising and/or rendering the primitives, and

wherein the render output is divided into a plurality of regions for rendering, each region comprising a respective area of the render output,

the method comprising:

for a set of one or more primitive(s) that is received to be processed:

determining for which of the plurality of regions into which the render output has been divided the set of one or more primitive(s) should be rendered;

storing at least some associated state data for rasterising and/or rendering the set of one or more primitive(s) in a “state data” data structure in memory; and

for each region of the render output it is determined the set of one or more primitive(s) should be rendered for storing in a respective data structure data structure for the region a reference to the associated state data for rasterising and/or rendering the set of one or more primitive(s) that is stored in the “state data” data structure, such that a reference to the associated state data stored in the “state data” data structure is stored in a respective, different data structure for each different region of the render output it is determined the primitive should be rendered for.

A second embodiment of the technology described herein comprises a graphics processing system comprising a memory and a graphics processor in communication with the memory, wherein the graphics processor is configured to generate a render output by rendering a plurality of primitives for the render output, wherein primitives are rendered by the graphics processor using associated state data indicative of the operations to be performed when rasterising and/or rendering the primitive, the graphics processor comprising:

a primitive sorting circuit that is configured to:

for a set of one or more primitive(s) that is received to be processed:

determine for which region(s) of a plurality of regions that the render output has been divided into for rendering purposes, each region comprising a respective area of the render output, the set of one or more primitive(s) should be rendered;

a primitive data storing circuit, configured to:

store at least some associated state data for rasterising and/or rendering the set of one or more primitive(s) in a “state data” data structure in memory; and

for each region of the render output it is determined the set of one or more primitive(s) should be rendered for store in a respective data structure data structure for the region a reference to the associated state data for rasterising and/or rendering the set of one or more primitive(s) that is stored in the “state data” data structure, such that a reference to the associated state data stored in the “state data” data structure is stored in a respective, different data structure for each different region of the render output it is determined the primitive should be rendered for.

In the technology described herein, the render output (which may, e.g., comprise at least a part of a frame to be displayed) is divided into a plurality of regions for rendering with each region including a respective area of the render output. The graphics primitives (which in an embodiment are initially defined by and represented as a set of vertices for each primitive) for the render output are then obtained and processed in order to determine associated primitive data that can be used by the graphics processor to render the primitives.

As part of this initial processing of the primitives, state (control) data indicative of the operations to be performed by the graphics processor when rasterising and/or rendering the primitive is obtained. This state data may, e.g., be defined, for groups of plural primitives, e.g., per draw call (and shared by and used for all the primitives in the group, e.g. draw call, in question).

The state data for a set of one or more primitive(s) in an embodiment includes the parameters for the processing of the primitive(s), e.g. control data specifying which operations to perform when rasterising and/or rendering the primitive(s), and so on. Any suitable state (control) information that may typically or desirably be used when rasterising and/or rendering graphics primitives may be used and/or included for this purpose.

The associated state data for a primitive (or set of primitives) may be generated, e.g., by a driver and/or specified by an application requiring the graphics processing operations, in the usual fashion.

Thus, in embodiments, when a group of primitives (e.g. a draw call) is received to be processed, the associated state data for rasterising and/or rendering the primitives (which may be shared for all of the primitives within the group) is obtained.

The primitives within the group are also processed to obtain any other primitive data (e.g. geometry data) that may be required when rasterising and/or rendering the primitives. For each primitive (or set of plural primitives that are processed together, which may, e.g., comprise a mesh/string or primitives) that is received to be processed, it is then determined for which region(s) of the render output the primitive(s) should be rendered for. This is in an embodiment done by checking which of the regions of the render output are at least partially covered by the primitive(s) in question.

The primitives are then organised on a “per region” basis with primitive data for rendering the primitives being stored in memory in a separate data structure for each of the respective different regions of the render output for which it is determined that the primitive(s) in question should be rendered. That is, primitive data is stored and organised in such “per region” data structures with primitive data for any primitives that need to be rendered for a particular render output region being stored in an associated data structure for that region.

Thus, when it is determined that a primitive should be rendered for plural different regions of the render output, the primitive data for the primitive is duplicated and stored in respective, different data structures for each of the regions of the render output for which it has been determined that the primitive should be rendered for.

In an embodiment, the primitive data that is stored for a primitive (or set of primitives) in the “per region” data structures comprises associated geometry data for rendering the primitive(s). Thus, in an embodiment, the graphics primitives are obtained and processed, e.g. in the usual fashion, in order to determined associated geometry data in a form that can be used by the graphics processor to rasterise/render the primitives (e.g. which geometry data may, and in an embodiment does, comprise a group of transformed, or “shaded”, vertices for each of the primitives).

Once the (e.g. transformed) geometry data has been obtained for a primitive (e.g. from a vertex shading circuit of the graphics processor), the geometry data is in an embodiment then stored in memory in a separate data structure for each of the respective different regions of the render output for which the primitive(s) in question is to be rendered.

It will be appreciated that any suitable primitive data that may be desired to be stored for a primitive may be stored in such data structures.

However, in the technology described herein, at least some of the state data for rasterising/rendering a primitive (or set of primitives) is stored in a separate (e.g. sideband) data structure (rather than being stored in the “per region” data structures).

For each primitive (or set of primitives) that is being processed in this way, a reference to the associated state data for that primitive (or set of primitives) stored in the “state data” data structure can then be (and is) included into the data structures for the respective different regions of the render output that the primitive is to be rendered for, e.g. along with the geometry data (where present) for rendering the primitive.

As mentioned above, some or all of the state data may be “shared” between plural primitives (or set of primitives), e.g. where the state data is defined on a per draw call basis. Thus, the reference to the associated state data that is stored for a particular primitive (or set of primitives) may be a shared reference for a group of plural primitives (e.g. a draw call) that share the associated state data. In that case, it is not necessary to duplicate the reference to the state data for each of the primitives associated with that state data for which primitive data is stored in the “per region” data structure. For example, if a reference to the relevant associated state data for a primitive for which primitive data is to be stored in a “per region” data structure is already stored in the per region data structure, it is not necessary to duplicate this reference (and thus, in embodiments, this is not done). The reference to the associated state data may, for example, comprise a suitable pointer, e.g. pointing to the location in the “state data” data structure at which the relevant associated state data is stored. Thus, in embodiments, the reference to the associated state data stored in the “state data” data structure for the primitive comprises a pointer to a memory location in the “state data” data structure where the associated state data is stored.

The pointer could, e.g., be in the form of a “full” (direct) pointer, or, e.g., an offset (an index) from a base pointer, etc. Various other arrangements would be possible in this regard and in general any suitable reference that allows the associated state data to be identified may be used and stored along with the geometry data for the primitive in the respective data structure(s) for the region(s) of the render output it is determined the primitive should be rendered for.

For each primitive (or set of primitives) there is therefore stored separately for the different render output region(s) that the primitive(s) should be rendered for a reference to the associated state data for the primitive(s), as well as any other primitive data, e.g. geometry data, that may be stored for the primitive(s), which data can be (and is) used when rasterising, and if necessary, rendering the region(s), e.g. as we will be explained further below. In particular, when it is desired to (at least in part) render a region of the render output, any primitive data stored in the respective per region data structure can then be read out and used to rasterise/render the primitives for which data is stored. As part of this, any references to associated state data stored in the “state data” data structure are read out and the associated state data for rasterising/rendering the primitives can thereby be extracted from the “state data” data structure.

The present Applicants have found that this approach may provide a more efficient way of storing state data for rasterising and/or rendering the primitives for the render output.

For instance, whilst various embodiments have been described with reference to the processing of, and storing primitive data associated with, a single primitive, it will be appreciated that these steps will typically be repeated for a plurality of primitives that are to be rendered when generating a render output.

Thus, when a new primitive is received to be processed, this is in an embodiment then processed in the same manner described above and the associated primitive (e.g. geometry) data written into the appropriate data structure(s) in memory based on which of the render output region(s) it is determined to fall at least partially inside.

The “full” associated state data for rasterising and/or rendering a primitive could be stored (directly) in the data structures for the respective different regions of the render output along with the associated, e.g., geometry data for the primitive (where present), and the state data duplicated, if necessary, for each region of the render output it is determined that the primitive should be rendered for. However, the (full) state data can be quite large, and any given piece of state data may potentially apply to many primitives. Storing the full state data for each primitive, and duplicating the state data in the data structures for each of the regions the primitives should be rendered for, may therefore be inefficient.

Even storing only the changes in state data between primitives (i.e. “deltas”) may still be inefficient since when the state does change, e.g., between different draw calls, the change in state may be relatively large.

On the other hand, in the technology described herein at least some of the associated state data for the primitives that are to be processed (and in an embodiment for all of the primitives that are to be processed) is stored together in the “state data” data structure. Storing the state data in this way in a separate “state data” data structure thus avoids over duplication of such state data. This may be particularly efficient since many different primitives may share the same state data. Thus, attempting to store the state data for each primitive, or even for each group of primitives (e.g. draw call) sharing the same state data, separately for each region in which each primitive is to be rendered for may involve significant duplication of the state data in and across the “per region” data structures which can be (and in an embodiment is) avoided in the technology described herein.

The “state data” data structure is thus, in effect, a buffer comprising a region of memory space that is allocated for, and used to temporarily store, state data that may be required when rasterising and/or rendering a plurality of primitives to generate a render output.

(It will be appreciated that the state data that is stored in the “state data” data structure in the technology described herein is the state data for rasterising and/or rendering a primitive, e.g. state data that is indicative of the rasterisation and rendering operations for determining the sampling points of an array of sampling points associated with render output to be processed are covered by the primitive, and then determining the appearance each sampling point should have to represent the primitive at that sampling point. On the other hand, any state data indicative of, e.g., vertex shading, or other geometry processing operations, does not need to be stored in the “state data” data structure (since the geometry state data has already been used when performing the geometry processing). The geometry state data can thus be (and in an embodiment is) discarded after the desired geometry processing has been performed and the geometry data sorted appropriately into the “per region” data structures.)

In embodiments, all of the rasterisation/rendering state data, e.g. for each and every group of primitives that is received to be processed, is stored in the separate “state data” data structure, and a suitable reference to the state data (only) is then included in the respective data structure(s) for the region(s) of the render output it is determined the primitive (or sets of primitives) within the group should be rendered for (i.e. in the “per region” data structures).

However, it would also be possible to store some of the state data itself in the per region data structures, and in embodiments this is done.

For instance, it may be particularly beneficial for state data that has a relatively large data size, or that changes only relatively infrequently (e.g. that is shared by many primitives), to be stored in the separate “state data” data structure, e.g. to avoid over duplication of such state data, as explained above.

On the other hand, there may also be advantages in having some of the state data for a primitive stored in the same place as the associated geometry data for rendering the primitive. This may, for example, facilitate access to that state data as it can be read out from the (same) data structure at the same time as the geometry data. Thus, some of the state data for a primitive may be stored in the “per region” data structures along with the geometry data for the primitives.

This may be done, for instance, for pieces of state data, e.g., that have only a relatively small data size, or that frequently change, since the cost for duplicating this data may be relatively low and outweighed by the benefits of having the state data in the same place as the geometry data. Typical examples of types of (“immediate”) state data which might be stored in this way may include state data indicative of, e.g., “clear” commands, for clearing, e.g., colour values, or immediate caches/buffers, or commands defining a scissor box. However, various other examples would also be possible.

Thus, in general, the state data for a primitive (or set of primitives) may be split between the “state data” data structure and the “per region” data structures in any suitable fashion, as desired, e.g. depending on the desired balance between avoiding over duplication of the state data and having the state data in the same place as the geometry data.

Thus, in embodiments, the method comprises storing (or correspondingly, the primitive storing circuit is configured to store) some of the associated state data for rasterising and/or rendering the set of one or more primitive(s) in the “state data” data structure and other of the associated state data in the respective data structure(s) for the each of the region(s) of the render output it is determined the set of one or more primitive(s) should be rendered for.

Which state data should be stored in which manner may be determined in any suitable manner. In embodiments this is determined based on the type of state data such that different types of state data (e.g. having different characteristic properties such as data size and/or expected lifetime) may be stored differently, e.g. such that a first type (or first types) of state data are stored in the respective, different data structures for each different region of the render output it is determined that the primitive(s) should be rendered for whereas a second type (or second types) of state data are stored in the “state data” data structure in the manner described above (with a reference to the state data being stored in the respective data structures for the different regions of the render output).

Thus, in embodiments, once the associated state data for a set of one or more primitive(s) has been obtained, state data of a first type (or set of first types) may be stored a respective, different data structure for each different region of the render output it is determined that the primitive(s) should be rendered for, whereas state data of a second type (of set of second types) may be stored in the “state data” data structure.

In some embodiments all state data of a certain type (or types) is stored in the “state data” data structure, and all state data of certain other types is stored in the “per region” data structures. However, it is also contemplated that the determination of whether state data should be stored in the respective data structures for the different regions of the render output (rather than in the “state data” data structure) may be made more dynamically, at least for certain types of state data. For example, this may involve determining the size of the state data, and then storing it either in the “state data” data structure or in each of the “per region” data structures, as necessary, in dependence on the determined size (e.g. with larger pieces of state data, above a certain threshold size, being stored in the “state data” data structure, and smaller pieces of state data stored in the “per region” data structures). Another example would be dynamically store certain types of state data in different fashions as a function of the frequency with which the state data is changing. Various other arrangements would be possible in this regard.

According to the technology described herein the render output is thus divided into a plurality of smaller area regions for rendering, and primitive data for the primitives to be rendered for the render output is stored in memory in respective data structures associated with the different render output regions (and which data structures are associated only with a particular region such that the primitive data is stored separately for different render output regions).

A plurality of such data structures are thus generated and at any instant in time there may therefore (and typically will) be a plurality of data structures in memory that are associated with, and contain respective primitive data for, a corresponding plurality of different regions of the render output.

An effect of this arrangement is that, because the primitive data can be (and is) stored separately for each of the render output regions, the respective sets of one or more primitive(s) for each render output region (for which primitive data is stored) can then be read out from the associated data structure and processed further by the graphics processor independently of any of the other render output regions. That is, each render output region for which data is stored can be processed independently of the other regions, using the respective data structure for the render output region.

For instance, once primitive data for a particular region has been written into an appropriate data structure in memory, that data can then be used in order to render the primitives for that region for which the primitive data is stored without necessarily having to wait on the processing of any other primitives (or any other regions). This means that at least some of the primitives that are to be rendered for the region may be (and in some embodiments are) rendered ‘early’ even though there are other yet to be processed primitives that may also need to be rendered for the region.

This approach is therefore in contrast to a traditional tile-based rendering system in which all of the primitive, e.g. geometry, etc., data for the entire render output must typically be processed up-front during an initial processing pass when generating the primitive lists (as it is only once all the geometry has been sorted into the regions that all the geometry that needs to be processed for a given tile will be known).

In such tile-based rendering systems the rasterising and rendering of the primitives in the tiles to generate the render output can accordingly only be done once all of the initial processing to sort the geometry, etc. into the regions (e.g. tiles) has been completed, and so, is, in effect, “deferred” until the initial processing of the primitives to sort them into the primitive lists has been completed.

Thus, in traditional tile-based rendering systems the primitive data for all of the primitives in the render output is typically stored together in such a manner that it is not possible to discern from the primitive data itself which primitives need to be rendered for which tiles, and this can only be done by reference to an additional data structure (i.e. the primitive lists) describing the spatial distribution of the primitives.

By contrast, in the technology described herein the primitive data is instead organised and stored on a per region basis, as explained above. Separate data structures can thus be generated (and then used), as required, for each of the regions as and when new primitive data that needs to be stored for those regions is generated, with the data structure for a particular region containing primitive data for that region (only).

Correspondingly, because the primitive data, etc., is stored for and organised as respective regions, there is no need for a separate data structure describing the spatial distribution of the primitives (e.g. a set of primitive lists).

It will be appreciated that this means data for the same primitive may therefore need to be stored in multiple places, i.e. a copy of the primitive data should be (and in embodiments is) stored in the respective data structures for each of the render output regions that the primitive needs to be rendered for. (In a traditional tile-based approach, the primitive data for each primitive may only need to be stored once, as the spatial distribution (locality) of the primitive is specified by the primitive lists.)

However, this also means that primitive data stored for a particular region (in its respective data structure) can be discarded after it has been used. An effect of storing the data in this fashion, with the primitive data being organised and stored in separate data structures for the respective regions of the render output, is that it can thereby be ensured that any primitive data that is stored for a particular region (in its respective data structure) necessarily has the same locality (i.e. is associated with the same render output region) and also the same “life-cycle”.

This means that it can therefore be guaranteed that any (and all) primitive data stored in a respective data structure for a particular region can be discarded once the primitive data has been used without impacting on any later rendering of the same, or any of the other, render output regions.

Accordingly, it is a benefit of the technology described herein that the primitive data stored in any one or more of the data structure(s) can be used, and then discarded, e.g. to free up memory space as required for new data as subsequent primitives are processed, even during the processing of a given render output unit of processing (e.g. draw call).

The technology described herein may therefore allow for an improved (more efficient) usage of memory space, as will be explained further below. In particular, since it is no longer necessary to wait for the processing for all of the geometry data for the entire render output unit of processing to complete before starting to use the geometry data to start rendering the output, the geometry data can be used, and the associated memory space reallocated, as required, in a more dynamic fashion.

For instance, in the technology described herein, the rendering may, in effect, be performed in a “partially deferred” manner, wherein stored primitive data for at least some of the regions can be processed and used to render (at least in part) those regions without having to wait on the processing of any other data (and independently of any other stored data and/or data that is yet to be processed).

The render output that is generated according to the technology described herein may, for example, comprise (at least a part of) a frame for display. For instance, the render output may comprise a (full) frame, or some other desired rendering unit, e.g. a draw call, for the frame. The render output is then generated by rendering one or more primitive(s) for the render output. The graphics processor in an embodiment uses associated state and geometry data when rendering the primitives, e.g. in the usual fashion.

For instance, the primitives may initially be defined by and represented as a set of vertices. Each vertex for a primitive has associated with it a set of data (such as position, colour, texture and other attributes data) representing the vertex.

The attributes of the vertices originally defined for a given graphics processing output (e.g. draw call) are thus in an embodiment subjected to an initial so-called “vertex shading” operation that operates to transform the attributes for each originally defined vertex into a desired form for the subsequent graphics processing operations. An initial processing of the primitives to generate associated geometry data may thus be performed comprising, for example, transforming the originally defined vertex position attributes from the world or user space that they are initially defined for to the screen space that the output of the graphics processing system is to be displayed in.

The initial processing of the primitives thus in an embodiment involves a step of vertex shading to generate transformed geometry data. The geometry data that is in an embodiment stored in the respective data structure(s) for the render output regions may thus comprise such transformed geometry data. Thus, in embodiments, geometry data is obtained from a vertex shading stage of the graphics processor (pipeline).

However, in general, any other geometry-related processing that may typically or desirably by performed in a graphics processing system may be performed at this stage in order to generate (e.g. transformed) geometry data and other such data defining the primitives in the display in a form that is appropriate for use when rasterising and rendering the primitives.

As mentioned above, the initial processing of the primitive(s) also comprises a step of determining associated state data for rasterising/rendering the primitive(s). The state data can then be suitably encoded (which may, for example, comprise encoding the state data in its entirety or as a set of delta (difference) values) and then written into the “state data” data structure, as required. In some embodiments the state data is encoded using a suitable hardware state encoder (circuit), e.g. as opposed to this being done by a software device driver. However, in general the state data may be encoded in any suitable fashion, as desired.

For instance, when a primitive (or set of plural primitives) is to be processed, the associated state data for the primitive is then obtained. If the associated state data is already stored in the “state data” data structure (e.g. since the state data is the same as for an earlier processed primitive), a suitable reference (e.g. pointer) to the associated state data can then be generated for inclusion into the data structure(s) for the respective region(s) of the render output along with the geometry data for the primitive.

Correspondingly, if the state data is not present in the “state data” data structure, a memory address in the “state data” data structure is in an embodiment allocated for the state data such that the state data can be written to the allocated memory address (e.g. after it has been encoded, where such encoding is performed), and a reference (e.g. pointer) to the state data generated accordingly for inclusion into the data structure(s) for the respective region(s) of the render output along with the geometry data for the primitive.

Similarly, once a reference to the associated state data for a primitive has been stored in the per region data structure, it may not be necessary to regenerate/duplicate the reference for another primitive that shares the same state data. That is, multiple primitives sharing the same state data (e.g. within a draw call) may use a single state data reference.

As explained above, according to the technology described herein the render output (e.g. frame, or frame portion) is divided into a plurality of regions. In an embodiment, the render output is divided into a plurality of uniformly sized, e.g. rectangular (e.g. square), regions. However, other arrangements would of course be possible.

The regions may generally have any size, as desired. For example, in some embodiments, each region may correspond to a 32×32 or 64×64 array of fragments (and so it will be appreciated that the regions may be larger than the typical rendering tile sizes for conventional tile-based graphics processing systems). However, this need not be the case.

When processing a primitive in the manner of the technology described herein it is determined for which regions the primitive needs to be rendered for. This may be done, for example, by determining the intersections of the primitive with the regions of the render output (in a similar manner as would be done in a more traditional tile-based rendering approach when binning the primitives into their respective regions for rendering).

For each region that a primitive needs to be rendered for, a data structure is generated and stored in memory, and the primitive data added into the data structure for the respective region(s), as required. There is therefore a self-contained data structure for each region of the render output that has a clear life-cycle and ownership of the data.

The data structure for a region may store the primitive (e.g. geometry) data in any suitable fashion. For instance, the data that is written into the per region data structures may be stored either directly or indirectly and may be stored in a compressed or uncompressed (raw) format, as desired. Similarly, the state data may be stored in the “state data” data structure in a compressed or uncompressed (raw) format, as desired.

In an embodiment, the primitive data is written into the appropriate data structure(s) in the order that the primitives are received for processing such that as and when (new) primitive data is written into an appropriate data structure, the ordering of the primitives is maintained in the data structure (such that the primitive draw order, e.g. as specified by the API, is preserved). The data structure for a particular region therefore in an embodiment comprises an in-order list for the primitive(s) to be rendered for the region.

While it would be possible to store all the primitive data for a region in sequence in a block (of the data structure), with all of the data for one primitive stored after the data for the preceding primitive, in embodiments, geometry data (where present) is stored in a different region of the data structure to any state data (and/or to the references thereto).

For example, in an embodiment, the geometry data for a (and each) primitive may include a set of vertex indices identifying the vertices for the primitive in question, as well as the (transformed) vertex data for the primitive. In that case, the vertex indices (and, in an embodiment, the references to state data) are in an embodiment stored in a first region of the data structure (a first set of memory positions/addresses) and the vertex data stored in a second, separate region of the data structure (a second set of memory positions/addresses).

For instance, the first region may contain a list of indices interspersed with state data (indicators) for the primitives (such that there will, e.g., be a state data indication for a draw call, followed by indices for plural primitives for that draw call, followed by a new state data indication (e.g. for a new draw call), followed by another sequence of indices for primitives, and so on), with the second region containing the associated vertex data for the primitives. Where the geometry data includes set(s) of vertex indices identifying the vertices to be used for primitives for the render output region in question, the vertices to be indicated in the data structure for the render output region in question are in an embodiment respectively indexed within a set of vertices for the region of the render output in question (as opposed to being indexed with respect to a set of vertices for the render output as a whole) to ensure the independence of the per region data structures.

The indices/state data may, for example, be written from the top down such that the list of indices/state data ‘grows’ down from the first available memory position. The vertex data may on the other hand ‘grow’ upwardly from the last available memory position.

However, other arrangements would of course be possible.

As will be appreciated from the above, in the technology described herein, data structures for respective regions of a render output will be generated and stored in memory.

In an embodiment, the memory space that is allocated to (and is available to be allocated to) a region comprises memory space from an appropriate pool of free memory space (a “heap”) for use by the graphics processor.

The pool may thus comprise a number of “blocks” of memory space each of which is available to be allocated for a region of the render output. A data structure for a particular region may thus comprise a set of one or more such block(s) of memory space. In some embodiments these are fixed-size blocks of memory space. However, this need not be the case, and it is also contemplated e.g. that the size of a memory block may be variable.

Once a block of memory space has been allocated for a particular region, any primitive data for the region can then be added into the block (at least until the block is full). In an embodiment this is done in the manner described above with the indices and any state data written from one end of the block (e.g. downwardly from the top of the block) and the vertex data written from the other end of the block (e.g. upwardly from the end of the block.

When a block is full, another block of memory space from the pool of free memory space can be allocated for the region, and a suitable pointer generated pointing from the end of the first block to the new block, and so on, to store the primitive data for the region. The data structure for a particular region may thus comprise a linked set of memory blocks.

In this case, each memory block making the data structure for a render output region will, in effect, and in an embodiment, store its own set of primitives for the render output region, and in a particular the primitive data, in an embodiment comprising geometry data and a reference to the associated state data, for a given subset of primitives within the overall set of primitives that is stored in the data structure for the render output region. In an embodiment each block of memory space itself comprises a “self-contained” set of data that can be processed independently of the other memory blocks of the data structure for the render output region (and that accordingly has its own independent life-cycle).

Thus, for example, where the geometry data includes set(s) of vertex indices identifying the vertices to be used for primitives for the render output region in question, then in an embodiment, the vertices to be indicated in the data structure for the render output region in question are respectively indexed within a set of vertices for not only the region of the render output in question but also for each block of memory space. However this is not necessary so long as the data structure for a particular region as a whole has its own self-contained life-cycle.

In an embodiment, the allocation of memory space within the memory space pool to primitive data (for render output regions) is performed by first allocating a block of memory space for a region, and then allocating space within that block to individual primitives that are determined to fall within that region (and that should therefore be rendered for the region), until the block is full (at which point, if there is still space in the memory space pool, a further block is allocated and then progressively filled with primitive data, and so on, until there is no more space in the memory space pool).

Thus, in embodiments, the memory space pool comprises a plurality of memory blocks, and generating a data structure for a region comprises: allocating a first memory block for the region and adding primitive data for the region into the first memory block until the first memory block is full; and when the first memory block is full, allocating a second memory block for the region and linking the first and second memory blocks such that the data structure comprises a set of linked memory blocks. This is in an embodiment then repeated if/when the second memory block becomes full, with a third memory block then being allocated and linked to the second memory block, and so on.

Correspondingly, the primitive data storing circuit is configured to generate a data structure for a region by: allocating a first memory block for the region and adding primitive data for the region into the first memory block until the first memory block is full; and when the first memory block is full, allocating a second memory block for the region and linking the first and second memory blocks such that the data structure includes a set of linked memory blocks.

Each block from the memory pool is in an embodiment the same size, and is in an embodiment configured to always be an integer number of cache lines (e.g. an integer number of 64-byte cache lines). This means that the start of each new block will be cache-line aligned. This arrangement may facilitate more efficient memory accesses, for example by facilitating using complete cache lines for the primitive data that is stored for each region.

The memory space may thus be (dynamically) partitioned into a list of ‘free’ memory blocks that have not (yet) been allocated as well as a number of lists of ‘active’ memory blocks that have been allocated for the different regions. As blocks are allocated, they are then removed from the free list and added to the active list for the associated region. Correspondingly, after the data in an active block has been used, it can then be discarded, and the block made available for reallocation, and moved back into the free list.

For instance, the Applicants have recognised that while in some cases the available memory space may be sufficiently large to store all of the primitive data that will be generated for the render output (such that the entirety of the primitive data may be written in order into the various data structures, and then passed to the next stage of the graphics processor (e.g. for rasterisation/rendering, as required) only after all of the data has been processed), in other cases there may only be a certain, fixed amount of memory available for the data structures for the different render output regions (and in embodiments this is the case) which can therefore become full as new data is added and memory space used up.

Provided that the available memory space is large enough, the technology described herein may be used to perform a fully “deferred” rendering process.

This may be the case, for example, when the primitive data is stored in a portion of main (system) memory (e.g. DRAM). In that case, the memory space may grow over time, as and when additional storage is required. Thus, in some embodiments, the primitive data may be continuously written into such data structures in memory until all of the primitives have been processed.

However, in other cases the available memory may become full as new data is added and memory space used up. That is, in some embodiments, the amount of memory space that is available to be allocated for primitive data is smaller than the amount of memory that would (be expected to) be required to store all of the primitive data that would be generated for the entire render output unit of processing.

For instance, this may be the case where the memory comprises a dedicated, fixed-footprint portion of SRAM, or where it is desired to store the primitive data more locally to the graphics processor in a suitable local cache system.

Indeed it is an advantage of the technology described herein that because memory space can be and is in an embodiment allocated for regions “on demand” when it is determined that a primitive is to be rendered for a region, a smaller amount of memory space can be set aside for storing the primitive data in comparison, e.g., to more traditional tile-based arrangements in which the primitive data for the entire render output must be stored before any of this data can be used.

For instance, in modern tile-based graphics processing systems, the primitive (geometry) data is increasingly too large to be effectively cached locally to the graphics processor. By contrast, in the technology described herein, memory space can be dynamically allocated, and then re-allocated as data structures are used up, and their associated memory space freed for new data. This makes it possible to use a relatively smaller amount of memory space, which may enable a more effective local caching of the primitive data, whilst maintaining throughput of primitive data.

In other words the technology described herein may help reduce the amount of “in flight” data that needs to be stored in the memory space at any given time. This may in turn facilitate an improved (more efficient) usage of available memory space and/or improvements in power or performance.

The technology described herein can thus advantageously be implemented using a range of different (sized) memory systems and may allow for various optimisations in terms of power and performance in each case. A benefit of the technology described herein is therefore that it provides a highly scalable approach that can be used in conjunction with a range of memory types (e.g. DRAM, SRAM, cache, etc.).

Thus, when new primitive data for a primitive associated with a particular region is to be written to memory, it is in an embodiment first determined whether memory space (a data structure) has already been allocated for the region. If memory space has already been allocated for the region, i.e. such that there already exists in memory a data structure for that region, the primitive data can then be added into the appropriate data structure in the allocated memory space for the region. In an embodiment the data structure comprises a number of memory blocks. When the current memory block is full, a new, free memory block can then be allocated and linked to the data structure.

On the other hand, if no memory space has yet been allocated for that region (and no data structure yet exists), memory space can be allocated for the region, and a new data structure for the region generated into which the geometry (and state (indicator)) data for the primitive can then be added. In an embodiment this is done by allocating a free block of memory space for the region in question.

Thus, in embodiments, the step of storing the primitive data in a respective data structure for a region comprises: determining (e.g. by the primitive data storing circuit of the graphics processor) whether a data structure for the region already exists in the memory, and when a data structure for the region already exists in the memory adding the primitive data to the existing data structure, whereas if no data structure for the region exists, the method comprises generating a new data structure for the region.

Correspondingly, the primitive data storing circuit may be configured to, when storing the primitive data in a respective data structure for a region: determine whether a data structure for the region already exists in the memory, and when a data structure for the region already exists in the memory add the primitive data to the existing data structure, whereas if no data structure for the region exists, the primitive data storing circuit is configured to generate a new data structure for the region.

It will be appreciated that in any of these cases, new memory blocks will periodically need to be allocated for storing primitive data (whether to expand the capacity for an existing region data structure, or to start a new region data structure). As such, the pool of available memory will progressively be used up (e.g. as memory blocks are allocated and moved from the ‘free’ list into the ‘active’ list) as data structures are generated and stored.

This being the case, the Applicants have recognised that when it is determined that the available memory pool is becoming full (or nearly full), it may be desirable to ‘flush’ out at least some of the (existing) data structures in memory. For instance, when there is new primitive data (either for a new region, or a region for which a data structure already exists in memory) to be written into memory, but the memory space is full (or nearly full), it may be desirable to start to use (and flush out) some of the data that is currently stored in memory, e.g. to allow for continued throughput of primitive data.

That is, when it is determined that there is no available memory, or less than a threshold amount of memory is available, some of the active blocks can be (and in an embodiment are) flushed from memory for use by the graphics processor, and then discarded to free up memory space for new data. For example, this may be done when it is determined that there is less than a (e.g. predetermined) threshold of available memory space, e.g. less than a threshold number of free memory blocks.

The technology described herein facilitates this operation because the primitive data is stored on a per region basis such that data can be selectively (and independently) flushed for one or more regions, and it is ensured that this data can be used, and then discarded to free up memory space, without impacting on any subsequent operations.

Thus, in an embodiment, when new primitive data is to be written to memory, but the memory is full (or more in an embodiment nearly full), one or more of the region(s) are selected to be rendered and the data in the associated data structure(s) in memory for the selected region(s) is then processed (used), such that the associated data structure(s) in memory for the selected region(s) can then be flushed from memory (the stored data discarded).

The method thus in an embodiment further comprises, tracking the available memory space, and determining when there is less than a threshold of available memory space. When it is determined that there is less than a threshold of available memory space the method may comprise: selecting one or more of the region(s) to be rendered, reading out the data stored in the data structure(s) for the selected region(s), and then discarding the data structure(s) for the selected region(s) to allow new data to be written into the memory space.

In particular, in embodiments, when attempting to allocate a new memory block (either to an existing data structure for a region, or to create a new data structure), it is in an embodiment determined whether there is less than a threshold of available memory space, and when there is less than the threshold of available memory space: selecting one or more region(s) for which a data structure already exists in memory to be flushed from memory; reading the data out from the data structure(s) for the selected region(s) for use by the graphics processor; and then discarding the data structure(s) for the selected region(s) from memory to free up memory space.

Correspondingly, when it is determined that new geometry data and state data for a primitive should be stored in one or more data structure(s) in memory, the primitive data storing circuit is configured to: determine whether there is less than a threshold of available space in the memory, and when there is less than the threshold of available space in the memory, a read-out circuit is configured to: select one or more region(s) for which a data structure already exists in memory to be flushed from memory; read the data out from the data structure(s) for the selected region(s) for use by the graphics processor; and then discard the data structure(s) for the selected region(s) from memory to free up memory space.

The regions (blocks) that are flushed (used) may be selected based on any suitable criteria. For instance, in one embodiment, it is determined for which region(s) the data structure is largest (e.g. containing the most number of memory blocks and/or the greatest amount of primitive data), and that data structure is then selected to be flushed (used). Thus, in embodiments, one or more region(s) are selected to be flushed based on for which of the region(s) the greatest amount of primitive data is (currently) stored in the memory. The read-out circuit may thus be configured to select region(s) to be flushed based on for which of the region(s) the greatest amount of primitive data is (currently) stored in the memory. The determination may however be made in a more or less sophisticated manner, as desired.

For instance, the determination may be made based on which region(s) have already been at least partly rendered. For example, the system may track how many primitives have been processed for the different regions and take account of this when selecting which region(s) to be flushed.

However, other arrangements would of course be possible. For example, the system may select region(s) to be flushed based on any suitable, e.g. lifetime, policy.

It may also be desirable to be able to explicitly flush (all of) the data structures from memory, e.g. for system maintenance purposes and/or at the end of a (e.g.) frame, and in embodiments this may be done.

In the technology described herein, in addition to the data structures for respective regions of a render output that are generated and stored in memory, e.g. in the manner described above, a separate “state data” data structure is maintained that is allocated for storing at least some of the state data required for rasterising/rendering the primitives for the render output.

The “state data” data structure in an embodiment resides in main (system) memory, e.g. DRAM. However, this need not be the case, and the “state data” data structure could in principle reside in any suitable portion of memory, as desired.

The “state data” data structure may generally have either a variable size or a fixed size. For instance, in some embodiments, the “state data” data structure may be able to grow over time as and when new state data needs to be added into the “state data” data structure, e.g. by allocating new memory addresses for the storage of state data.

However, in some embodiments the “state data” data structure has a fixed size. In that case the size of the “state data” data structure may be selected appropriately, e.g., based on the amount of state data that is (expected) to be stored for a given render output. For example, the size of the “state data” data structure may be set based on the number of (e.g.) draw calls for the render output and the size of the state data that is to be stored for each draw call.

Where there is only a certain, fixed amount of available memory allocated for the “state data” data structure (which is the case in some embodiments) the “state data” data structure may become full as new state data is added and memory space used up.

In that case, a flushing mechanism is in an embodiment provided to avoid overflowing of the “state data” data structure, and to allow continued throughput of state data and continued generation of the render output, e.g. in a similar manner as described above for the region data structures including the primitive (geometry) data.

It will be appreciated that because the “state data” data structure may contain state data for any (and all) primitives that may be received to be processed when generating the render output, the life-cycle of the “state data” data structure is typically longer than the life-cycle for the primitive data stored in the respective data structures for the different regions.

For instance, in embodiments the “state data” data structure is used to store state data that may potentially be required for all of the primitives that are to be processed for the render output, and the life-cycle of the “state data” data structure may therefore be the life-cycle of the render output.

Which state data in the “state data” data structure is associated with which primitives could be tracked (e.g. by storing reverse references to the primitives), to thereby dynamically re-allocate available memory, e.g. in a similar manner as described above, by freeing up the state data to be released once it had been used (once the primitives it is needed for have been processed).

However, because the state data for a primitive may be associated with a plurality of different render output regions, which may be rendered independently and in any order, this may be impractical. Thus, in embodiments, it is not tracked which primitives (in which regions of the render output) require which state data in the “state data” data structure.

In this case, the Applicants have recognised that the “state data” data structure should not be, and in an embodiment is not, “flushed” until all of the respective data structures for the different regions that may require state data currently residing in the “state data” data structure have been processed.

Accordingly, in an embodiment, when the “state data” data structure becomes full, all of the data structures for the different render output regions that are currently stored in memory are flushed (as well as the “state data” data structure).

The available memory space in the “state data” data structure is thus in an embodiment tracked, and when it is determined that there is less than a threshold amount of available memory space in the “state data” data structure, all of the regions of the render output for which primitive data is currently stored in respective data structures for the regions are selected to be flushed, and the primitive data stored therein is read out along with the associated state data for the primitives, e.g. for use by the graphics processor. Once all of the currently stored primitive data has been used (e.g. for rendering the associated primitives), the associated state data stored in the “state data” can then also be flushed, and discarded, to free up memory space in the “state data” data structure for new state data.

Thus, in embodiments, when it is determined that new state data should be stored in the “state data” data structure, determining whether there is less than a threshold of available space in the “state data” data structure, and when there is less than the threshold of available space in the “state data” data structure: selecting all region(s) for which a data structure already exists in memory to be flushed from memory; reading the primitive data out from the data structure(s) for the region(s) for use by the graphics processor; and then flushing the state data from the “state data” data structure to free up space in the “state data” data structure.

The Applicants have thus recognised that the different lifecycles for the “state data” data structure and the “per region” data structures mean that these should be managed differently. For instance, as explained above, when it is determined that the “state data” data structure is becoming full, in order to flush the “state data” data structure, all of the “per region” data structures that are currently stored should also be released.

On the other hand, when it is determined that memory space for the “per region” data structures is becoming full, such that one or more region(s) of the render output are selected for flushing, e.g. in the manner described above, in that case the data structures for the selected region(s) are freed up to be released, however the “state data” data structure should not be, and in an embodiment therefore is not, flushed since the stored state data may still be required for the rendering of other regions of the render output.

Thus, in embodiments, when it is determined that new data for a primitive should be stored in one or more of the data structure(s) for the regions of the render output in memory, it is determined whether there is less than a threshold of available space in the memory, and when there is less than the threshold of available space in the memory, the method comprises: selecting one or more region(s) for which a data structure already exists in memory to be flushed from memory; reading the data out from the data structure(s) for the selected region(s) for use by the graphics processor; reading the associated state data for the primitive(s) to be rendered for the selected region(s) from the “state data” data structure; and then discarding the data structure(s) for the selected region(s) from memory to free up memory space, but not discarding the associated state data from the “state data” data structure.

In embodiments, in order to avoid potential stalling when the “state data” data structure has to be flushed in this way, double (or triple, etc.) buffering techniques may be used for managing the state data. Thus, in embodiments, the “state data” data structure may comprise multiple (e.g. two) buffers. Various arrangements would be possible in this regard.

It will be appreciated that depending on the size of the “state data” data structure, the amount of state data that is generated, and the ratio of state data to primitives, in many cases the “state data” data structure may not need to be flushed in this way during the generation of a render output. For example, it may typically be the case that many (thousands of) primitives share the same state data, in which case the processing throughput may generally be limited by the primitive (geometry) data. However, there may be instances where the state data changes relatively frequently between primitives, in which case the “state data” data structure may need to be regularly flushed in order to ensure continued throughput of data (i.e. in order to use the primitive data).

As mentioned above, this can also be controlled by appropriately splitting the state data so that some of the state data for rasterising/rendering a primitive is stored alongside the geometry data rather than in the “state data” data structure.

The “state data” data structure may also be explicitly flushed, e.g. for system maintenance purposes and/or at the end of a (e.g.) frame, and in embodiments this is done.

The data from the data structure(s) for the selected region(s) is in an embodiment read out from memory and then used for rasterising/rendering the primitive(s) for the region. For example, the data may be read out and then passed to a rasterisation circuit of the graphics processor, wherein the primitives are in an embodiment rasterised (optionally after any primitive set-up is performed) and then, if needed, rendered for the output.

A read-out circuit of the graphics processor may thus be configured to read the data out from the data structure(s) for the selected region(s) for use by the graphics processor by passing the geometry data (and state data) to the graphics processor for rendering the primitives for which such data is stored in the data structure(s) for the selected region(s). Reading the primitive data out from the data structure(s) for the selected region(s) thus in an embodiment comprises passing the geometry data to the graphics processor; obtaining the associated state data from the “state data” data structure using the reference; and passing the associated state data to the graphics processor for rendering the primitives for which such data is stored in the data structure(s) for the selected region(s).

Thus, the graphics processor can start to render the selected render output region(s) using the data stored in its associated data structure.

It will be appreciated that the region(s) may only be partially rendered at this point since only the primitives for which data is currently stored (which may be less than all of the primitives that ultimately need to be rendered for the region) is flushed at this point. However, there may be further primitives that are to be rendered for that region, which have not yet been processed. In that case, when such primitives are processed, a new data structure for the region can be generated in the manner described herein, and then used/flushed, and so on, until all of the primitives have been processed.

Thus, in embodiments, the method may comprise selecting a first region to be flushed, rendering one or more primitive(s) for the first region using the geometry data and state data stored for the one or more primitive(s) in the respective data structure for the first region, and (after the data in the data structure has been used) discarding the data structure for the first region. When it is determined that a subsequent primitive should be rendered for the first region, the method then comprises generating a new data structure in memory for the first region, and so on.

Correspondingly, the read-out circuit may be configured to select a first region to be flushed, and to then read out the primitive data stored in the respective data structure for the first region so that the primitive data can then be used to render one or more primitive(s) for the first region. The data structure can then be discarded after the data has been used. When it is determined that a subsequent primitive should be rendered for the first region the primitive data storing circuit is then configured to generate a new data structure in memory for the first region.

Of course, in general, this may be performed for any, or a plurality of regions. Thus, at any instant in time, there may be a plurality of data structures for a corresponding plurality of regions, and these data structures may be flushed, and new data structures generated, as required.

However, other arrangements would of course be possible. For example, the flushed data need not be used directly (immediately) by the graphics processor for rasterising, etc., the primitive(s), and at least some of the data may be transferred to and temporarily held in other storage such as an intermediate buffer, or a different portion of (e.g. DRAM) memory, or similar. In that case, the associated memory blocks can be freed up by moving the data to such other storage. The flushed data can then be rendered from the other storage, e.g. at the appropriate time.

As discussed above, an advantage of the technology described herein is therefore that the primitive data is stored separately for each region such that the data can be used independently. Accordingly, when it is determined that there is no available memory, or less than a threshold amount of memory is available, one or more of the data structures (for a corresponding one or more region(s) of the render output) are in an embodiment read out from memory at this point and passed to the next stage of the graphics processor, e.g. for rasterisation and rendering. This helps ensure continued throughput of primitive data and a more efficient use of the available memory space.

Further, because the data is stored on a per region basis, it can be ensured that once the data has been used, it will not be needed again (e.g. for another region, since it would already be stored separately in the appropriate data structure for the other region), and so can be discarded at this point.

The memory space can thus be dynamically reallocated over time as and when new primitive data is generated. For instance, where there is a fixed region of memory that is partitioned into a number of fixed size blocks, the blocks can be allocated, used and re-allocated accordingly as the free list is consumed to maintain throughput whilst still allowing all of the data to be used and without impacting on any other operations.

This arrangement provides a more efficient usage of memory that can be readily implemented (and scaled) based on the amount of available memory space.

In some embodiments each and every primitive that is received to be processed is processed in the same manner described above, i.e. by determining which render output regions the primitive should be rendered for, and then storing the primitive data in respective data structures for each region that it has been determined the primitive should be rendered for (such that where a primitive falls into multiple different regions, a copy of the primitive data for the primitive is stored in the respective data structures for each region).

However, it is also contemplated that less than all of the primitives may be processed in this manner. For instance, in some cases it may be desirable for some of the primitives to be processed and stored in a different manner. Thus, in some embodiments, when a new primitive is received to be processed, the method may further comprise first checking whether the primitive should be processed in the manner described above (and if so, proceeding to do so). Various options would be possible in this regard.

The technology described herein can be used for all forms of output that a graphics processor may be used to generate, such as frames for display, render-to-texture outputs, etc.

The graphics processor in an embodiment executes a graphics processing pipeline that can contain any suitable and desired processing stages, etc. that a graphics processing pipeline may normally include.

In some embodiments, the graphics processor comprises, and/or is in communication with, one or more memories and/or memory devices that store the data described herein, such as the primitive (geometry and state) data, etc., and/or store software for performing the processes described herein. The graphics processing pipeline may also be in communication with a host microprocessor, and/or with a display for displaying images based on the data generated by the graphics processor.

In an embodiment, the various functions of the technology described herein are carried out on a single graphics processing platform that generates and outputs the rendered fragment data that is, e.g., written to a frame buffer for a display device.

The technology described herein can be implemented in any suitable system, such as a suitably configured micro-processor based system. In an embodiment, the technology described herein is implemented in a computer and/or micro-processor based system.

The various functions of the technology described herein can be carried out in any desired and suitable manner. For example, the functions of the technology described herein can be implemented in hardware or software, as desired. Thus, for example, the various functional elements, stages, and pipelines of the technology described herein may comprise a suitable processor or processors, controller or controllers, functional units, circuits/circuitry, processing logic, microprocessor arrangements, etc., that are operable to perform the various functions, etc., such as appropriately configured dedicated hardware elements or processing circuits/circuitry, and/or programmable hardware elements or processing circuits/circuitry that can be programmed to operate in the desired manner.

It should also be noted here that, as will be appreciated by those skilled in the art, the various functions, etc., of the technology described herein may be duplicated and/or carried out in parallel on a given processor. Equally, the various processing stages may share processing circuits/circuitry, if desired.

Thus the technology described herein extends to a graphics processor and to a graphics processing platform including the apparatus of or operated in accordance with any one or more of the embodiments of the technology described herein described herein. Subject to any hardware necessary to carry out the specific functions discussed above, such a graphics processor can otherwise include any one or more or all of the usual functional units, etc., that graphics processors include.

It will also be appreciated by those skilled in the art that all of the described embodiments of the technology described herein can, and in an embodiment do, include, as appropriate, any one or more or all of the optional features described herein.

The methods in accordance with the technology described herein may be implemented at least partially using software e.g. computer programs. It will thus be seen that when viewed from further embodiments the technology described herein comprises computer software specifically adapted to carry out the methods herein described when installed on a data processor, a computer program element comprising computer software code portions for performing the methods herein described when the program element is run on a data processor, and a computer program comprising code means adapted to perform all the steps of a method or of the methods herein described when the program is run on a data processing system. The data processor may be a microprocessor system, a programmable FPGA (field programmable gate array), etc.

The technology described herein also extends to a computer software carrier comprising such software which when used to operate a graphics processor, renderer or microprocessor system comprising a data processor causes in conjunction with said data processor said processor, renderer or system to carry out the steps of the methods of the technology described herein. Such a computer software carrier could be a physical storage medium such as a ROM chip, RAM, flash memory, CD ROM or disk, or could be a signal such as an electronic signal over wires, an optical signal or a radio signal such as to a satellite or the like.

It will further be appreciated that not all steps of the methods of the technology described herein need be carried out by computer software and thus from a further broad embodiment the technology described herein comprises computer software and such software installed on a computer software carrier for carrying out at least one of the steps of the methods set out herein.

The technology described herein may accordingly suitably be embodied as a computer program product for use with a computer system. Such an implementation may comprise a series of computer readable instructions fixed on a tangible medium, such as a non-transitory computer readable medium, for example, diskette, CD-ROM, ROM, RAM, flash memory or hard disk. It could also comprise a series of computer readable instructions transmittable to a computer system, via a modem or other interface device, over either a tangible medium, including but not limited to optical or analogue communications lines, or intangibly using wireless techniques, including but not limited to microwave, infrared or other transmission techniques. The series of computer readable instructions embodies all or part of the functionality previously described herein.

Those skilled in the art will appreciate that such computer readable instructions can be written in a number of programming languages for use with many computer architectures or operating systems. Further, such instructions may be stored using any memory technology, present or future, including but not limited to, semiconductor, magnetic, or optical, or transmitted using any communications technology, present or future, including but not limited to optical, infrared, or microwave. It is contemplated that such a computer program product may be distributed as a removable medium with accompanying printed or electronic documentation, for example, shrink-wrapped software, pre-loaded with a computer system, for example, on a system ROM or fixed disk, or distributed from a server or electronic bulletin board over a network, for example, the Internet or World Wide Web.

Various embodiments will now be described, by way of example only, and with reference to the accompanying drawings.

The technology described herein generally relates to methods for processing graphics primitives wherein the render output is divided into a plurality of smaller regions (areas) for rendering. In the present embodiments the primitive data is stored and organised on a per region basis. When a primitive is received for processing, it is thus determined for which region(s) of the plurality of regions into which the render output has been divided that the primitive should be rendered for, and the primitive data for the primitive (e.g. the geometry data representing the primitive and any state data indicative of the operations to be performed when rendering the primitive) is then stored in respective, different data structures for each different region of the render output, as will be explained further below.

However, by way of comparison, a more traditional tile-based rendering system will first be described with reference to FIGS. 1, 2 and 3. In a tile-based rendering system the render output is divided into a plurality of tiles for rendering. The tiles are then rendered separately to generate the render output. To do this, it is first necessary to sort the primitives according to which tiles they should be rendered for.

The primitive vertices are thus obtained and the usual geometry processing (e.g. vertex shading) is performed for all of the primitives in order to generate the post-transformed geometry data (e.g. transformed vertices).

In order to be able to know which primitives should be rendered for which tiles it is required to perform this processing up front for all of the primitives that are to be processed. The result of this is, as shown in FIG. 1, that all of the geometry data generated from the geometry processing 10 is then stored in memory 12 in a first data structure 16. The primitive lists are stored in a separate data structure 18 and any pixel state data is stored in a further data structure 14.

As shown in FIG. 2, once all of the geometry processing for the render output has completed, this data is then read out from memory and subject to further graphics processing 20 to generate the render output which may, for example, be written into a framebuffer 22. Other arrangements would of course be possible.

In particular, the graphics processing 20 is performed by using the primitive lists 18 to determine which primitives should be rendered and then rendering these primitives appropriately using the stored geometry data 16 and associated pixel state information 14. The rendering process is shown schematically in FIG. 3 (which illustrates a hierarchical binning process wherein primitive data is binned over a plurality of different levels (tile sizes), although this is not necessary and the binning may generally be performed in a more or less sophisticated manner as desired).

In the traditional tile-based graphics processing operation described above all of the geometry processing for the render output is performed in one go during an initial processing pass. This data is then used in a second processing pass during which the render output is generated by rasterising/rendering the primitive using their associated geometry.

For modern graphics processors, the primitive data for the render output can be relatively large such that it cannot be effectively cached in local storage associated with the graphics processor. The primitive data is therefore typically written back to main (system) memory, or at least to a relatively larger cache in the memory hierarchy.

The present embodiments provide a more efficient usage of memory. In particular, in the present embodiments, rather than storing all of the state and geometry data for the render output together, along with a separate binning data structure (e.g. the primitive lists) describing the spatial distribution of the primitives, the render output (e.g. framebuffer) is divided into a plurality of smaller area regions, and the state data and geometry data is stored in separate data structures for each of the render output regions.

Thus, as shown in FIG. 4, each region of the render output 40 (e.g. frame buffer region) is associated with a respective data structure 42 in memory that contains pixel state and geometry data for that region (only). This means that each region can be processed independently, as illustrated in FIG. 5, using the data stored in its respective data structure 42.

FIG. 6 illustrates the management of state data in a traditional tile-based graphics processing system. As shown, in FIG. 6, a software device driver 6 allocates a data structure 14 in memory for the pixel state data and the full state data is then placed into the data structure 14 by the driver 6. The geometry processing 10 and binning then proceeds in the usual fashion and the primitive lists 18 reference the pixel state 14 appropriately.

FIG. 7 illustrates the management of state data according to an embodiment. In this embodiment the state data is again generated by the driver 6. However, rather than the driver 6 placing the full state data directly into a respective data structure in memory, the state data is processed along with the geometry data. The geometry processing 10 thus sorts the primitives, in the manner described above, and determines which regions of the render output which primitives are to be rendered for. Any state data associated with the geometry processing operations can then be discarded at this point.

At least some of the state data for rasterising and/or rendering the primitives (i.e. the pixel state data) is passed from the geometry processing circuit 10 to a suitable state encoder 7 that encodes the state (either in complete or delta representations) into an auxiliary “state data” data structure 9 residing in main (DRAM) memory. The state encoder 7 is suitably implemented in hardware which manages the allocation of the state data into the “state data” data structure 9 (in contrast to the arrangement in FIG. 6 where the allocation of state data is controlled by the software driver 6).

The geometry data for the primitives is then written into respective data structures 42 for the different regions of the render output. At the same time as the geometry data for a primitive is written into the respective data structures 42 for the different regions of the render output, the geometry processing circuit 10 also includes a suitable reference to the associated pixel state data that was sent to the state encoder 7 and added into the “state data” data structure 9 into the respective data structures 42 for the different regions of the render output for which the primitive data is stored.

The primitives for a region can then be rendered using the geometry data stored in the respective data structure 42 for the region and any associated state data that is stored in the state data” data structure 9 (and for which a suitable reference is included in the respective data structure 42 for the region to allow the associated state data to be extracted).

FIG. 8 shows an example of a data structure 60 for a render output region according to the present embodiments. The data structure 60 comprises an in-order list of data for any primitives for which it has been determined that the primitive should be rendered for the render output region associated with the data structure 60.

In particular, the data structure 60 includes a reference 61, e.g. in the form of a suitable pointer, to the state data stored in the auxiliary “state data” data structure 9. This is followed by the primitive vertex index references 64 for the primitive(s) using the referenced state data. As shown, the state (references) and primitive vertex index references are stored in a first region of the data structure 60 that grows down from the top of the data structure (i.e. the first available memory position). Thus, a reference 61 to the location of the full state set for the first primitive (or set of primitives) in the external “state data” data structure 9 is stored, followed by the appropriate vertex index references 64 for that primitive. In this embodiment, ‘immediate’ state data 63 for the next primitive(s) is then added directly into the data structure 60. This is then followed by the next set of primitive vertex index references 64, another reference to external state data 61, and so on.

Thus, it will be appreciated that in this embodiment the state data is ‘split’ such that some of the state data is stored externally in the auxiliary “state data” data structure 9, with an appropriate reference 64 thereto included in the data structure 60, whereas some of the state data 63 is stored in the data structure 60 itself.

The vertex data 66 itself (e.g. transformed vertex positions, etc.) is stored in a second region of the data structure 60 that grows upwardly from the bottom of the data structure.

In the present embodiments the memory space may be portioned into a plurality of memory “blocks” (or “chunks”). Thus, when a data structure for a region is generated, a memory block from the pool of available memory blocks can be allocated accordingly. As new primitive data for that region is processed, this memory block may become full.

The data structure 60 shown in FIG. 8 may therefore represent a single memory block. As the memory block becomes full, a second memory block can be allocated for the render output region and a link included in the first memory block pointing to the next memory block, and so on. The data structure for a particular region may thus comprise a linked list of memory blocks.

The overall operation of the graphics processing system according to the present embodiments will now be described with reference to FIG. 9.

FIG. 9 shows an example of a graphics processing pipeline that may be executed on a graphics processor that is communicating with a memory system. The memory system may be a cache, or may comprise a dedicated portion of SRAM or DRAM.

The first stage of the graphics processing pipeline comprises a command processor 80 that receives and processes commands, e.g. from an application requesting the graphics processing operation. The commands may specify, for example, a render output that is to be generated by reference to the primitives that need to be rendered.

Any state data that is specified for the primitives is then passed to the state encoder 7 and the state data is then encoded and written, as appropriate, into the “state data” data structure 9 in memory 12.

In the next stage, the primitive's vertices are obtained and then processed accordingly, e.g. by shading the vertices and/or primitives in the usual fashion.

After the vertex and primitive shader stage(s) 81, an initial step of primitive assembly and culling 82 may then be performed based on the primitive data.

The primitives are then sorted based on which regions they are to be rendered for and the primitive data is then written into the respective memory data structures 42 appropriately. At the same time, the references to the state data stored in the “state data” data structure 9 are also written into the respective memory data structures 42.

The primitive binning 83 according to the present embodiment is illustrated in more detail in FIG. 10. As shown, when a draw call is received (step 90), with associated state and primitive data, a portion of memory space in the “state data” data structure is allocated for the state data (step 91).

So long as there is available memory space for the state data, the state data is then encoded (step 92) and written into the allocated memory space in the “state data” data structure.

For each primitive within the draw call that is to be processed (i.e. for each primitive passing through the graphics processing pipeline), it is first determined which region(s) of the frame buffer the primitive is to be rendered for.

For example, this may be done by intersecting the primitive with the frame buffer regions and determining that the primitive should be rendered for any regions that are at least partially covered by the primitive (step 93). The primitive data should then be written into the respective data structures for each region for which it has been determined that the primitive is to be rendered for.

To do this, an attempt to allocate memory space for the primitive data is made (step 94). If there is sufficient memory available, the primitive data can then be suitably compressed, if desired, and the data packed appropriately ready to be written into the respective data structures (step 95). The primitive is then written into either an existing data structure for the respective region (if one exists) or into a new data structure generated for the region (if no such data structure exists already) (step 96).

On the other hand, when it is determined that there is no memory space available either for storing the state data (at step 91), or for storing the primitive data (at step 94), or at least that less than a threshold of memory space is available, some of the data that is currently stored is selected to be flushed from the memory.

For instance, where there is no available memory space for new primitive data, one of more frame buffer regions are selected to be flushed, and the bin reader 85 is then initiated to read the data for those regions (step 97).

Once the data has been used (read out), the corresponding memory blocks can then be released for re-use, in order to free up memory space, which can then be allocated for the new primitive data (step 98).

In this case, the “state data” data structure 9 is not flushed (and should not be flushed since it may contain state data for any primitives within the render output, which region(s) may not (yet) have been selected to be flushed).

On the other hand, when there is no available memory space for new state data, i.e. the “state data” data structure 9 is becoming full, the “state data” data structure 9 is then flushed. However, because the “state data” data structure 9 may contain state data for any and all of the primitives for which data is currently stored, before the “state data” data structure 9 is flushed to free up space for new state data, all of the regions of the render output for which data is currently stored (i.e. for which data structures currently exist) should first be flushed so that the state data is used for rendering these regions before it is discarded.

The data that is read out is then passed to a suitable primitive set up/rasterisation circuit 86, and then onto a pixel shader 87, as appropriate, before being blended and written out into the frame buffer by a suitable blending and pixel write out stage 88.

This is illustrated in further detail in FIG. 12. As shown in FIG. 12, the data that is read out from memory 12 is processed in order to extract the geometry data (step 85-1), and then to extract the pixel state (step 85-2), which data is then rasterised and rendered as described above.

The regions can thus be flushed and the associated data used independently (e.g. as shown in FIG. 5).

The foregoing detailed description has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the technology described herein to the precise form disclosed. Many modifications and variations are possible in the light of the above teaching. The described embodiments were chosen in order to best explain the principles of the technology described herein and its practical applications, to thereby enable others skilled in the art to best utilise the technology described herein, in various embodiments and with various modifications as are suited to the particular use contemplated. It is intended that the scope be defined by the claims appended hereto. 

What is claimed is:
 1. A method of processing graphics primitives using a graphics processing system comprising a memory and a graphics processor in communication with the memory, wherein the graphics processor is configured to generate a render output by rendering a plurality of primitives for the render output, wherein primitives are rendered by the graphics processor using associated state data indicative of the operations to be performed when rasterising and/or rendering the primitive, and wherein the render output is divided into a plurality of regions for rendering, each region comprising a respective area of the render output, the method comprising: for a set of one or more primitive(s) that is received to be processed: determining for which of the plurality of regions into which the render output has been divided the set of one or more primitive(s) should be rendered; storing at least some associated state data for rendering the set of one or more primitive(s) in a “state data” data structure in memory; and for each region of the render output it is determined the set of one or more primitive(s) should be rendered for, storing at least some primitive data for rendering the set of one or more primitive(s) in a respective, different data structure for each different region of the render output it is determined that the primitive(s) should be rendered for, each said different region having its own respective different data structure, and storing in the respective data structure data structure for each different region a reference to the associated state data for rendering the set of one or more primitive(s) that is stored in the “state data” data structure, such that a reference to the associated state data stored in the “state data” data structure is stored in a respective, different data structure for each different region of the render output it is determined the primitive should be rendered for.
 2. The method of claim 1, wherein the reference to the associated state data stored in the “state data” data structure for the primitive comprises a pointer to a memory location in the “state data” data structure where the associated state data is stored.
 3. The method of claim 1, comprising storing some of the associated state data for rendering the set of one or more primitive(s) in the “state data” data structure and storing other of the associated state data in the respective data structure(s) for the each of the region(s) of the render output it is determined the set of one or more primitive(s) should be rendered for.
 4. The method of claim 3, wherein state data of a first type is stored in the respective data structure(s) for the each of the region(s) of the render output it is determined the set of one or more primitive(s) should be rendered for whereas state data of a second, different type is stored in the “state data” data structure.
 5. The method of claim 1, wherein when it is determined that new data for a primitive should be stored in one or more of the data structure(s) for the regions of the render output in memory, determining whether there is less than a threshold of available space in the memory, and when there is less than the threshold of available space in the memory: selecting one or more region(s) for which a data structure already exists in memory to be flushed from memory; reading the data out from the data structure(s) for the selected region(s) for use by the graphics processor; reading the associated state data for the primitive(s) to be rendered for the selected region(s) from the “state data” data structure; and then discarding the data structure(s) for the selected region(s) from memory to free up memory space, but not discarding the associated state data from the “state data” data structure.
 6. The method of claim 5, wherein reading the primitive data out from the data structure(s) for the selected region(s) for use by the graphics processor comprises: passing the geometry data to the graphics processor; obtaining the associated state data from the “state data” data structure using the reference; and passing the associated state data to the graphics processor for rendering the primitives for which such data is stored in the data structure(s) for the selected region(s).
 7. The method of claim 1, wherein: when it is determined that new state data should be stored in the “state data” data structure, determining whether there is less than a threshold of available space in the “state data” data structure, and when there is less than the threshold of available space in the “state data” data structure: selecting all region(s) for which a data structure already exists in memory to be flushed from memory; reading the primitive data out from the data structure(s) for the region(s) for use by the graphics processor; and then flushing the state data from the “state data” data structure to free up space in the “state data” data structure.
 8. A non-transitory computer readable storage medium storing software code that when executing on a data processor performs a method of processing graphics primitives using a graphics processing system comprising a memory and a graphics processor in communication with the memory, wherein the graphics processor is configured to generate a render output by rendering a plurality of primitives for the render output, wherein primitives are rendered by the graphics processor using associated state data indicative of the operations to be performed when rasterising and/or rendering the primitive, and wherein the render output is divided into a plurality of regions for rendering, each region comprising a respective area of the render output, the method comprising: for a set of one or more primitive(s) that is received to be processed: determining for which of the plurality of regions into which the render output has been divided the set of one or more primitive(s) should be rendered; storing at least some associated state data for rendering the set of one or more primitive(s) in a “state data” data structure in memory; and for each region of the render output it is determined the set of one or more primitive(s) should be rendered for, storing at least some primitive data for rendering the set of one or more primitive(s) in a respective, different data structure for each different region of the render output it is determined that the primitive(s) should be rendered for, each said different region having its own respective, different data structure, and storing in the respective data structure data structure for each different region a reference to the associated state data for rendering the set of one or more primitive(s) that is stored in the “state data” data structure, such that a reference to the associated state data stored in the “state data” data structure is stored in the respective, different data structure for each different region of the render output it is determined the primitive should be rendered for.
 9. A graphics processing system comprising a memory and a graphics processor in communication with the memory, wherein the graphics processor is configured to generate a render output by rendering a plurality of primitives for the render output, wherein primitives are rendered by the graphics processor using associated state data indicative of the operations to be performed when rasterising and/or rendering the primitive, the graphics processor comprising: a primitive sorting circuit that is configured to: for a set of one or more primitive(s) that is received to be processed: determine for which region(s) of a plurality of regions that the render output has been divided into for rendering purposes, each region comprising a respective area of the render output, the set of one or more primitive(s) should be rendered; a primitive data storing circuit, configured to: store at least some associated state data for rendering the set of one or more primitive(s) in a “state data” data structure in memory; and for each region of the render output it is determined the set of one or more primitive(s) should be rendered for, store at least some primitive data for rendering the set of one or more primitive(s) in a respective, different data structure for each different region of the render output it is determined that the primitive(s) should be rendered for, each said different region having its own respective, different data structure, and store in the respective data structure data structure for each different region a reference to the associated state data for rendering the set of one or more primitive(s) that is stored in the “state data” data structure, such that a reference to the associated state data stored in the “state data” data structure is stored in the respective, different data structure for each different region of the render output it is determined the primitive should be rendered for.
 10. The system of claim 9, wherein the reference to the associated state data stored in the “state data” data structure for the primitive comprises a pointer to a memory location in the “state data” data structure where the associated state data is stored.
 11. The system of claim 9, wherein the primitive data storing circuit is configured to: store some of the associated state data for rasterising and/or rendering the set of one or more primitive(s) in the “state data” data structure and store other of the associated state data in the respective data structure(s) for the each of the region(s) of the render output it is determined the set of one or more primitive(s) should be rendered for.
 12. The system of claim 11, wherein state data of a first type is stored in the respective data structure(s) for the each of the region(s) of the render output it is determined the set of one or more primitive(s) should be rendered for whereas state data of a second, different type is stored in the “state data” data structure.
 13. The system of claim 9, wherein when it is determined that new data for a primitive should be stored in one or more of the data structure(s) for the regions of the render output in memory, the primitive data storing circuit is configured to: determine whether there is less than a threshold of available space in the memory, and when there is less than the threshold of available space in the memory, a read-out circuit is configured to: select one or more region(s) for which a data structure already exists in memory to be flushed from memory; read the data out from the data structure(s) for the selected region(s) for use by the graphics processor; read the associated state data for the primitive(s) to be rendered for the selected region(s) from the “state data” data structure; and then discard the data structure(s) for the selected region(s) from memory to free up memory space, but not discard the associated state data from the “state data” data structure.
 14. The system of claim 13, wherein the read-out circuit in configured to read the primitive data out from the data structure(s) for the selected region(s) for use by the graphics processor by: passing the geometry data to the graphics processor; obtaining the associated state data from the “state data” data structure using the reference; and passing the associated state data to the graphics processor for rendering the primitives for which such data is stored in the data structure(s) for the selected region(s).
 15. The system of claim 9, wherein: when it is determined that new state data should be stored in the “state data” data structure, the primitive data storing circuit is configured to: determine whether there is less than a threshold of available space in the “state data” data structure, and when there is less than the threshold of available space in the “state data” data structure, a read-out circuit is configured to: select all region(s) for which a data structure already exists in memory to be flushed from memory; read the primitive data out from the data structure(s) for the region(s) for use by the graphics processor; and then flush the state data from the “state data” data structure to free up space in the “state data” data structure. 